#!/bin/bash

source /etc/profile
source ./cluster_IP.conf

cmd="ls"

if [ $# -eq 1 ]; then
    cmd=$1
fi

# 通过ssh连接到所有ECS，执行命令
for ip in ${CEPH_IPs[@]}; do
    echo "=========== exec $cmd in $ip ==========="
    ssh $ip $cmd
done